//简历职业意向
import React, { Component } from 'react'
import {
    View,
    Text,
    TouchableOpacity,
} from 'react-native';

import { resumethreeStyle as styles } from '../../../../../styles';
import Icon from 'react-native-vector-icons/Ionicons';


export default class Resumevocation extends Component {
    constructor(props) {
        super(props);
    }
    render() {
        return (
            <View style={styles.threeall}>
                <Text style={styles.threetop}>职业意向</Text>
                <Text style={styles.threeev}>期望行业：<Text style={styles.threesm}>{this.fieldName(this.props.resume.fields, 9)}</Text></Text>
                <Text style={styles.threeev}>期望职能：<Text style={styles.threesm}>{this.props.resume.resumeIntentPosition}</Text></Text>
                <Text style={styles.threeev}>期望地点：<Text style={styles.threesm}>{this.props.resume.resumeIntentWorkspace}</Text></Text>
                <Text style={styles.threeev}>期望年薪：<Text style={styles.threesm}>{this.props.resume.resumeIntentMm}</Text></Text>
                <Text style={styles.threeev}>目前年薪：<Text style={styles.threesm}>{this.props.resume.resumeMm}</Text></Text>

                <TouchableOpacity activeOpacity={1} style={styles.touch}
                    onPress={() => { this.goGet('Rposedit', this.props.resume, this.props.actions) }}>
                    <Icon
                        name={'md-create'}
                        size={16}
                        color={'#3d9ccc'}
                    />
                </TouchableOpacity>
            </View>

        )
    }
    //期望行业：
    fieldName(List, sl) {
        let data = {
            cont: List
        }
        let arr = '';
        let s = sl;
        let length = data.cont.length;
        if (length <= s) {
            s = length;
        }
        for (let i = 0; i < s; i++) {
            if (data.cont[i].fieldType == '3') {
                arr += data.cont[i].fieldName + '/';
            }
        }
        if (arr.endsWith('/')) {
            arr = arr.substr(0, arr.length - 1);
        }
        return arr;
    }

    goGet(name, object, action) {
        this.props.navigation.navigate(name, { resume: object, actions: action });
    }
}